package database

import (
	"gorm.io/gen"
	"gorm.io/gorm"
)

func DuckUserGen(db *gorm.DB) {
	g := gen.NewGenerator(gen.Config{
		OutPath:      "./internal/user/database/dal",
		ModelPkgPath: "./internal/user/database/model",
		Mode:         gen.WithoutContext | gen.WithDefaultQuery | gen.WithQueryInterface, // generate mode
	})
	g.UseDB(db) // reuse your gorm db
	g.ApplyBasic(g.GenerateAllTable()...)
	g.Execute()
}
